package com.sacc.controller;

import com.power.common.model.CommonResult;
import com.sacc.pojo.BoxCollected;
import com.sacc.service.BoxCollectedService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


/**
 * @author 滚~韬
 * @date 2022/4/16 19:30
 */
@RestController
@RequestMapping("/box/unadopted")
public class BoxCollectedController {
    @Autowired
    private BoxCollectedService boxCollectedService;
    //收藏蜂箱
    @PostMapping("/collect")
    private CommonResult CollectBox(@RequestBody BoxCollected boxCollected){
        BoxCollected temp = new BoxCollected();
        temp.setBoxId(boxCollected.getBoxId());
        temp.setOpenId(boxCollected.getOpenId());
        DeleteBox(temp);
        return boxCollectedService.Collect(boxCollected);
    }
    //不收藏蜂箱
    @PostMapping("/delete")
    private CommonResult DeleteBox(@RequestBody BoxCollected boxCollected){
        return boxCollectedService.Delete(boxCollected);
    }


}
